<?php

include_once("./vendor/autoload.php");

use YouBaoLian\YouBaoLian;

$youBaoLian = new YouBaoLian([
    'timeout' => 120,
    'logsDir' => './logs',
    'appId' => '202203231030000110024757',
    'gateway' => 'http://insured-open.youbaolian.top/gateway',
    'publicKey' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzddCXGlF6r+TB3JJQBxY+UzVqAH0FpLpYTboIDS5tHL6GH8EVWod/oPK7QPNVrYgoDXAqh6FOpNepYePaouLpbDOFMrJjfdL/bRDSP8PNftxUvAw42B49rEdQmQXJ3bTIuxGmJZFl3QMMiYJTgMs0ZjpjXQjCuzbzxpQQ2zMKghY02cP2wtoV+6NfVAuvg8XaE4KqXdLM8XggePNe800G0etl/KJKgmawaXYYJl6LUQmwFq5jJdLd74RH5CJFofMoXC22knMANMvNXlkAHL4r2AQLICSI12MI6iwvcLKf9jdCVX6Xe9fP5Lylafhscb5b2brt93gEq8p9bmksZCYgwIDAQAB',
    'privateKey' => 'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDN10JcaUXqv5MHcklAHFj5TNWoAfQWkulhNuggNLm0cvoYfwRVah3+g8rtA81WtiCgNcCqHoU6k16lh49qi4ulsM4UysmN90v9tENI/w81+3FS8DDjYHj2sR1CZBcndtMi7EaYlkWXdAwyJglOAyzRmOmNdCMK7NvPGlBDbMwqCFjTZw/bC2hX7o19UC6+DxdoTgqpd0szxeCB4817zTQbR62X8okqCZrBpdhgmXotRCbAWrmMl0t3vhEfkIkWh8yhcLbaScwA0y81eWQAcvivYBAsgJIjXYwjqLC9wsp/2N0JVfpd718/kvKVp+GxxvlvZuu33eASryn1uaSxkJiDAgMBAAECggEBAMiJNnWheiRBj5Rpm0OCWoxGdsC/ZnW3mvbC71KxC1rpyQ2kcSxlveL/sutGEP6xYQe0VodmRJXUjRjnAKnkWaCKp7tJ9SMCEl6RCBxNoRwOY1FR/88FZdOwqbjMmmIwOXKEjiKKBDKRNH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
    'encryptKey' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhV/P0lwnMAxnKe6SrfCCOBE4oWlwr5n0F1G0GLaIQB6AdPTFNFTp8H2Rwl0g+ZZXTzwOJRSSJXNUgpZEFxlOb6QTWakTg/176tuGVxDFW4BfGaosbkLrpiu0fdKGWe77IWoMkasvDqObfPh8daVUM8WSi62QqHCBSZMdOVkBMSOnvV0HuQDjm+Vs/QM2UT3U4+A5USy+Ig3pP9/FyxcBz5eud/f3ypTkigmRnIb2qStm8Nf5CTszUbzMdBX3LErSYz5QUOUMGdyR/NyKMR0ekZ3UBKmEdBzKrRGp6TAWhHm/Tj9l/RN35UNxKaZDGWln+euWV52gHuzVJkLww4ho0QIDAQAB'
]);

//城市编码
$cityCode = '510100';


//2925388 平安1
//2925392 ql-永诚
//2925418 人保
//2925422 QL新-珠峰
//2925409 HA-华安
//2926146 太平洋

//报价配置ID
$configId = 2926146;
//$configId = '';

//保司ID
//$supplierId = 9803; //平安
//$supplierId = 9806;//永诚财险
//$supplierId = 9801; //人保
//$supplierId = 9876; //珠峰
//$supplierId = 9810; //华安
//$supplierId = 9870; //太平洋
$supplierId = 9870; //华安

//customerId
$customerId = 8621237; //平安
//$customerId = 0;


$licenseNo = '川A22HN8';
$franeNo = $vehicleFrameNo = 'LS5A3DBE0GA065430';
$engineNo = 'GC9X073278';
$ownerIdCard = '510181197501066426';
$brand = '长安牌SC7164A';
$firstRegisterDate = '2016-06-30';

$ownerName = '张小红';
$ownerPhone = '13551054219';
$ownerAddress = '四川省通江县瓦室镇长春村二社';

//续保查询
if (0) {
    $renewalRequest = new \YouBaoLian\Application\Request\VehicleRenewalRequest();
    $renewalRequest->setCityCode($cityCode);
    $renewalRequest->setConfigId($configId);
    $renewalRequest->setEngineNo($engineNo);
    $renewalRequest->setFrameNo($franeNo);
    $renewalRequest->setLicenseNo($licenseNo);
    $renewalRequest->setSupplierId($supplierId);
    $renewalRequest->setOwnerIDCard($ownerIdCard);
    $renewalRequest->setCustomerId($customerId);

    $response = $youBaoLian->renewal($renewalRequest);

    if (!$response->isSuccess()) {
        outLog('查询失败:' . $response->getError());
    } else {
        if (!$response->hasRenewalInfo()) {
            outLog('无续保信息');
        } else {
            outLog('往年商业险终止日期:') . $response->getBiEndDate();
            outLog('往年交强险终止日期:') . $response->getCiEndDate();
            var_dump($response->getRenewalInfo());
            var_dump($response->getRenewalDtoList());
            var_dump($response->getCoverageList());
            var_dump($response->getRenewSupplierId());
        }
    }

    exit;
}

//车型查询
if (0) {
    $vehicleModelRequest = new \YouBaoLian\Application\Request\VehicleModelRequest();
    $vehicleModelRequest->setBrand($brand);
    $vehicleModelRequest->setCityCode($cityCode);
    $vehicleModelRequest->setConfigId($configId);
    $vehicleModelRequest->setEngineNo($engineNo);
    $vehicleModelRequest->setFirstRegisterDate($firstRegisterDate);
    $vehicleModelRequest->setLicenseNo($licenseNo);
    $vehicleModelRequest->setFrameNo('');

    $response = $youBaoLian->model($vehicleModelRequest);

    if (!$response->isSuccess()) {
        outLog('error:' . $response->getError());
    } else {
        var_dump($response->getModelList());
    }
    exit;

}

$ownerShipAttribute = 1;//车辆所属性质
$usageAttribute = 1; //车辆使用性质
$seat = 7;

//非车产品查询
if (1) {
    $request = new \YouBaoLian\Application\Request\VehicleNoCarProductRequest();
    $request->setSupplierId($supplierId);
    $request->setConfigId($configId);
    $request->setOwnerShipAttribute($usageAttribute);
    $request->setUsageAttribute($ownerShipAttribute);
    $request->setSeats($seat);
    $request->setCityCode($cityCode);
    $request->setVehicleTonnages(0);
    $request->setExtParam([
        'vehicleClassCode' => '',
        'vehicleStyleCode'=> '',
        'energyType' => '',
        'ownerName' => '',
        'certificateNo' => '',
        'licenseNo' => '',
        'frameNo' => '',
        'firstRegisterDate' => '',
        'engineNo' => '',
        'plateType' => '',
        'autoModelCode' => '',
        'isTrans' => '',
        'transDate' => '',
        'certificateType' => '',
    ]);

    $response = $youBaoLian->noCarProduct($request);

    var_dump($response->getInsuredWithCarProduct());
    var_dump($response->getProductPlans());
    var_dump($response->getProductTypes());
    exit;

}
$ciBeginData = '2022-06-15 00:00:00';
$biBeginData = '2022-06-15 00:00:00';

//$ciBeginData = '2022-05-05 00:00:00';
//$biBeginData = '2022-05-05 00:00:00';


$modelCode = 'FA6664CE436420EDA4708852EEE75E86';
$modelName = '长安SC7164A轿车';
$energyType = '0';
$exhaustCapability = '1.598';
$vehicleTonnages = 0;   //核载质量
$wholeWeight = 1270;    //整备质量
$carPrice = 66900;
$seatNum = 5;
$power = 0;

$licenseColorCode = '1';  //号牌颜色代码 1:蓝 2:黄 d:渐变绿
$plateTypeCode = '02';   //号牌种类 小型汽车号牌

//计算车辆实际价值接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleActualPriceRequest();

    $request->setConfigId($configId);
    $request->setStartDate($biBeginData);
    $request->setEnrollDate($firstRegisterDate);
    $request->setSeatCount($seat);
    $request->setTonNumber(0);
    $request->setPurchasePrice($carPrice);
    $request->setCarKindCode('1');
    $request->setUseNatureCode('1');

    $response = $youBaoLian->actualPrice($request);

    if (!$response->isSuccess()) {
        outLog('error:' . $response->getError());
    } else {
        outLog('折扣价:' . $response->getActualValue());
        outLog('折旧使用的费率:' . $response->getActualRate());
        outLog('实际价值最大值:' . $response->getActualValueMax());
        outLog('实际价值最小值:' . $response->getActualValueMin());
    }

    exit;
}

//$actualValue = 185086.2;
$actualValue = 38400.6;

//保费计算
if (0) {
    $t1 = microtime(true);
    $request = new \YouBaoLian\Application\Request\VehicleQuoteRequest();

    $request->setCiBeginDate($ciBeginData);
    $request->setBiBeginDate($biBeginData);
    $request->setCityCode($cityCode);
    $request->setSupplierId($supplierId);
    $request->setConfigId($configId);
    $request->setRenewSupplierId(0);

    $person = new \YouBaoLian\Application\Info\PersonInfo();
    $person->setName($ownerName);
    $person->setMobile($ownerPhone);
    $person->setIdCard($ownerIdCard);
    $person->setIdType(1);
    $person->setAddress($ownerAddress);
    $person->setIdCardStartDate('2000-01-01');
    $person->setIdCardEndDate('2099-12-31');
    //关系人
    $request->setApplicantInfo($person);
    $request->setInsuredInfo($person);
    $request->setOwnerInfo($person);
    //车辆信息
    $carInfo = new \YouBaoLian\Application\Info\CarInfo();
    $carInfo->setLicenseNo($licenseNo);
    $carInfo->setFrameNo($franeNo);
    $carInfo->setEngineNo($engineNo);
    $carInfo->setAutoModelName($brand);
    $carInfo->setOwnershipAttribute($ownerShipAttribute);
    $carInfo->setDefaultModelCode($modelCode);
    $carInfo->setDefaultModelName($modelName);
    $carInfo->setEnergyType($energyType);
    $carInfo->setExhaustCapability($exhaustCapability);
    $carInfo->setFirstRegisterDate($firstRegisterDate);
    $carInfo->setVehicleTonnages(0);
    $carInfo->setWholeWeight($wholeWeight);
    $carInfo->setCarPrice($carPrice);
    $carInfo->setCarPriceWithOutTax($carPrice);
    $carInfo->setIsTrans(1);
    $carInfo->setTransDate('');
    $carInfo->setIssueDate($firstRegisterDate);
    $carInfo->setLicenseColorCode($licenseColorCode);
    $carInfo->setPlateTypeCode($plateTypeCode);
    $carInfo->setVehicleStyleCode('K31');
    $carInfo->setPower($power);
    $carInfo->setSeats($seatNum);
    $carInfo->setUsageAttribute($usageAttribute);
    $carInfo->setVehicleClassCode('1');
    $carInfo->setDrivingLicenseModel('');
    $carInfo->setCarCertificateNo('');
    $carInfo->setVehicleSrcCertiDate('');
    $carInfo->setVehicleSrcCertiType('');

    $request->setCarInfo($carInfo);
    //车船税信息
    $carTaxInfo = new \YouBaoLian\Application\Info\CarTaxInfo();

    $carTaxInfo->setVvTaxState('');
    $carTaxInfo->setBaseTaxation('');
    $carTaxInfo->setFreeRate('');
    $carTaxInfo->setTaxRelief('');
    $carTaxInfo->setReductionText('');
    $carTaxInfo->setRelifReason('');
    $carTaxInfo->setTaxDep('');
    $carTaxInfo->setTaxDepCode('');
    $carTaxInfo->setTaxDocumentDate('');
    $carTaxInfo->setTaxPaidAreaCode('');
    $carTaxInfo->setTaxNo('');

    $request->setCarTaxInfo($carTaxInfo);

    //险种
    $coverageList = new \YouBaoLian\Application\Info\CoverageList();

    $coverageList->append('10501', 0);
    $coverageList->append('10001', 0);
    //单独车轮
//    $coverageList->append('20209', 100, 0, 0, [
//        'subsidiary' => 2,
//        'unitAmount' => 100,
//    ]);

//    $coverageList->append('10002', 2000000);
//    $coverageList->append('10004', 10000);
//    $coverageList->append('10005', 10000);
    //道路救援
//    $coverageList->append('20261', 0, 0, 0, ['serviceNum' => 7]);

    $request->setCoverageList($coverageList);
    //新能源汽车 投保附加自用充电桩

//    $chargingPostList = new \YouBaoLian\Application\Info\ChargingPostList();
//    $chargingPostList->append('1', '1', '1', '充电桩设备名称');
//    $request->setChargingPostList($chargingPostList);

    //扩展信息
    $extInfo = new \YouBaoLian\Application\Info\ExtInfo();
    $extInfo->setCarCheckStatus('1');
    $request->setExtInfo($extInfo);

    //非车险信息
    $insProductPlansList = new \YouBaoLian\Application\Info\InsProductPlansList();
    $insProductPlansList->append(
        '1',
        '7E37EEDC24085F3D896F6998A976ADB3',
        'A43D1CEAB7A9C50273E33ABE835D2CE4',
        '03');
    $request->setInsProductPlans($insProductPlansList);
//
    //北京兼业从业人员
//    $jianYeSalerInfo = new \YouBaoLian\Application\Info\ParergonSaleInfo();
//    $jianYeSalerInfo->setName('');
//    $jianYeSalerInfo->setTelephone('');
//    $jianYeSalerInfo->setSalerSortNo('');
//    $jianYeSalerInfo->setPracticeCertificateNo('');
//    $request->setJianYeSalerInfo($jianYeSalerInfo);

    //广东，深圳双录销售信息
//    $saleInfo = new \YouBaoLian\Application\Info\SaleInfo();
//    $request->setSaleInfo($saleInfo);

    //
//    $request->setIsOfferLocalUseProof();
//    $request->setBusinessLevel();

    $request->setCustomerId($customerId);

    $response = $youBaoLian->quote($request);
    outLog('执行时间' . (microtime(true) - $t1));
    outLog('报价状态' . $response->getStatus());

    if (!$response->isSuccess()) {

        if ($response->getReInsureFlg()) {
            outLog('重复投保：' . $response->getRepeatInsureInfo());
        } else {
            outLog('error:' . $response->getError());
        }
    } else {
        outLog('priceItemId:' . $response->getPriceItemId());
        outLog('totalPrice:' . $response->getTotalPrice());
    }

    exit;
}

//报价Id
$priceItemId = 2925422;
//撤单接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleRevokeRequest();

    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);

    $response = $youBaoLian->revoke($request);

    var_dump($response->getStatus());
    var_dump($response->getInfo());
    exit;
}
//上传影像接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleUploadImgRequest();
    $request->setConfigId(2925422);
    $request->setPriceItemId('28771972');
    $url = 'http://static.flashmiao.com/excel/202220/汽车合格证.jpeg';

    $dist = './33.jpeg';
    file_put_contents($dist, file_get_contents($url));

    $type = getimagesize($dist)['mime'];

    $imgBase64 = chunk_split(base64_encode(file_get_contents($url)));

    $string = str_replace("\r\n",'',$imgBase64);

    file_put_contents('./222.txt',$string);

    $request->append('1', $string);

    $response = $youBaoLian->uploadImg($request);

    if (!$response->isSuccess()) {
        outLog($response->getMessage());
    } else {
        var_dump($response->getUploadUrl());
        var_dump($response->getData());
    }
    exit;
}
//特约查询接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleQuerySpecialRequest();

    $request->setPriceItemId($priceItemId);
    $request->setConfigId($configId);
    $request->setSupplierId($supplierId);

    $response = $youBaoLian->querySpecial($request);
//    var_dump($response->getSupplierId());
//    var_dump($response->getTotal());
    var_dump($response->getData());
    exit;
}

//核保提交接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleSubmitUnderWriteRequest();
    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);
    $request->setCustomerId($customerId);

    $response = $youBaoLian->underwriting($request);

    if (!$response->isSuccess()) {
        var_dump($response->getSlipNo());
        var_dump($response->getBiSlipNo());
        var_dump($response->getCiSlipNo());
        var_dump($response->getInsuredId());

        outLog('核保失败:' . $response->getError());
    } else {
        var_dump($response->getSlipNo());
        var_dump($response->getBiSlipNo());
        var_dump($response->getCiSlipNo());
        var_dump($response->getInsuredId());
        outLog('核保ID:' . $response->getInsuredId());
    }
    exit;
}

//核保ID
$insuredId = 226473;

//支付接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehiclePaymentRequest();

    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);

    $response = $youBaoLian->paying($request);

    var_dump($response->getBiSlipNo());
    var_dump($response->getCiSlipNo());
    var_dump($response->getLicenseNo());
//    var_dump($response->getQrCodeImg());
    var_dump($response->getTotalPrice());

    file_put_contents('./1.txt', $response->getQrCodeImg());
    exit;
}

//短信发送接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleSendSmsCodeRequest();

    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);
    $request->setInsuredId($insuredId);

    $response = $youBaoLian->sendSmsCode($request);

    var_dump($response->isSendSuccess());
    var_dump($response->getVerifyCodeStatus());
    var_dump($response->getFailMessage());

}

//短信消费接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleVerifySmsCodeRequest();

    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);
    $request->setVerificationCode('123456');

    $response = $youBaoLian->verifySmsCode($request);

    var_dump($response->isSuccess());

}

//电子保单接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleElecPolicyRequest();
    $request->setConfigId($configId);
    $request->setInsuredId($insuredId);
    $request->setInsuranceType(10);
    $request->setPolicyNo('');

    $response = $youBaoLian->ePolicy($request);

    var_dump($response->isSuccess());

    var_dump($response->getEPolicyLink());
    var_dump($response->getCiFlagLink());

}


//报价单详情查询接口
if (0) {
    $priceItemId = 28292370;
    $request = new \YouBaoLian\Application\Request\VehiclePriceDetailRequest();

    $request->setConfigId($configId);
    $request->setPriceItemId($priceItemId);

    $response = $youBaoLian->priceDetail($request);

    var_dump($response->getTotalPremium());
    var_dump($response->getStatus());
    var_dump($response->getCiBeginDate());
    var_dump($response->getCoverageList());
}

//从业人员查询接口
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleQuerySalesPersonRequest();

    $request->setConfigId($configId);
    $request->setLicenseNo('');
    $request->setFrameNo('');
    $request->setSaleCode('');

    $response = $youBaoLian->querySalesPerson($request);

    var_dump($response->getSalerInfoList());

}

//查询报价单状态
if (0) {
    $request = new \YouBaoLian\Application\Request\VehicleQueryPriceStatusRequest();

    $request->setConfigId($configId);
    $request->setInsuredId($insuredId);

    $response = $youBaoLian->queryPriceStatus($request);

    var_dump($response->getLicenseNo());
    var_dump($response->getVehicleFrameNo());
    var_dump($response->getInsuredList());
    var_dump($response->getProductPlan());
}

//非车产品责任明细查询接口
if (1) {
    $request = new \YouBaoLian\Application\Request\VehicleNoCarProductDetailRequest();

    $request->setConfigId($configId);
    $request->setSupplierId($supplierId);
    $request->setCityCode($cityCode);

    $request->setVersion('1.01');
    $request->setPlanCode('52009D33BF7298226495E26EA2DE9AAF');
    $request->setProductCode('3D0F8FEAECE7DF2A1D9BE89C56C07CEB');
    $request->setProductType('03');

    $response = $youBaoLian->noCarProductDetail($request);
    var_dump($response->getList());
    exit;
}


$string = '{"bizContent":"KNZ3ReaJcWLzP5Nm/5o0+AT07VnAdPcYTvAPBioItQGQ8u/2LFwapwxkWmf6BnZC1Pyxkt4FVz8kyHRbBihCmqVtUYh14zy7rJd8MvyBoq5lWM8AihABX9LvpK9siMuhe6/n8W6GTix9zWQ4BmjZ7zkfwCOhgCgxjkpGv4F88+x+IAJ9D2BvG+nZvxyAE36I+jRT4o+r6GCzCdAY0fNZTb6jj0JXP7r/hZQoFPVuW+s0hPGkJswE822vyJEDA5km01iJXiPW/DRQNzDAFz4511zIOI407oEh5/VwjiE87ozAzWGYSutBhEIuHssI/cke8Yz4J3gD9y/XDwaOBXVG2mgciOpGzSJSTnHMInB9MpCPKSCS94b7zDnz7LWv43BqobGLaw8NoEE1/EHdEGqkjmNH8GIYfXyifzruKQHSQi+nAnY7HATMwef7BUcWh7gMSMttYkAi4J7jDlGBuWXqbh9tCJNKQsMhykRHTo3I8jBdvUGXe/76sQNCn2I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R5+vyjlh2MgcM/T6+Hz5zRMYe9QY6Q8FQjxXnwMeyG1gj/luiNNxqRUa0jj3heQHB6r4FZyKiRoSyFi62XcPnNa2RFmndoYy5Ys1+X44hjbuN3APbvUkJzR3G6V+P9xvWUxe7H+gAymQ28HDL6IgUkS5WBRrfSx0074Q6VMxRkAFC8uOtfO+w3+TPjiQUxYug3ooU53Mo5UUygDbnGrN3TmNuHqAFgfO14MaMr5gV77xBYcy1MUUNH9lWhHFtnIfpjrJg8E6PVMezWU+pUO6Q1HWjrlqrlLjX662iFeJ+agbQlL/f/pBwfX1QY94FFsMGFcKQdeJ/Kzkwy4KQmavkm2KO9+DdBbk+55wWYylXyo4cVJsvZuflIuAnZ5yrGrA0pgBvC2oblZg7UXDudA95LY1Aoe1NCfFiUh0ZCVEYKwwClhMSChUnpZAs5m2fQq0EuXjHT9GGp17sg+F5gWIwpsUaJeMUUYP","code":0,"message":"success","requestId":"47ccdb0c7f34f2632487e5da057a33678d3dfdcb","responseTime":"2022-03-29 15:37:02","sign":"dxi6jLd7v3gheNPwTDadLIhV0LfcQOx06otWPIFNEWIcdm+1qZ5t4Yvs/Ivtw5rQjbQqN+FKX1ScBQeqyFMhmmX3ootnc9IO/hugQCn/iGzJgvwG4fX7PvCKI/B4cQTDN8thefY9474e0LZdPrZgFriRUnyI4d98C/EEcRBTeeqPGYClgH2008qn+vuIu8mJz9WEpIaJ0u98n/uSp7PacLCvYxSPWKbhYN/+lqzcfhDtkvwyalGJYiOtJRz0Z8MGN332YkFKpPSh8Hq9bOXUpxnvuh+CZeM2HetDqqbuqUk6QxSi9T7ktfU0XfCXJ8TJuv1/Fs65jMbb0H5Yv+rQLw=="}';

//人工核保结果回调接口
if (0) {
    $response = new \YouBaoLian\Application\Callback\VehicleManualUnderwritingRequest();

    $response->build($string);

    $youBaoLian->verifySign($response);

    var_dump($response->isSuccess());
    var_dump($response->getInfoList());

}

//支付成功回调接口
if (0) {
    $response = new \YouBaoLian\Application\Callback\VehiclePaymentRequest();

    $response->build($string);
    $youBaoLian->verifySign($response);

    var_dump($response->isSuccess());
    var_dump($response->getStatus());
    var_dump($response->getPayDate());
    var_dump($response->getPayAmount());
    var_dump($response->getInfoList());
}

//保单生效回调接口
if (0) {
    $response = new \YouBaoLian\Application\Callback\VehiclePolicyRequest();
    $response->build($string);
    $youBaoLian->verifySign($response);

    var_dump($response->isSuccess());
    var_dump($response->getBusinessId());
    var_dump($response->getInfoList());
}


function outLog($string)
{
    echo $string . "\r\n";
}